package test;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.ResolvableType;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.FileSystemResource;
import pojo.Person;

public class demo01 {
    public static void main(String[] args) {
        BeanFactory bf = new XmlBeanFactory(new ClassPathResource("applicationContext.xml"));
        BeanFactory bf1 = new XmlBeanFactory(new FileSystemResource("C:\\Users\\wl\\Desktop\\牛逼\\java83\\day02\\src\\applicationContext.xml"));
        Person person = (Person) bf.getBean("person");
        person.eat();
        System.out.println(person);
        Person person1 = (Person) bf1.getBean("person");
        person1.eat();
        System.out.println(person1);
    }
}
